#!/bin/sh

git pull origin
sleep 3s

mvn clean package -P demo

service tomcat0 stop
sleep 3s

rm -fr /data/tomcats/tomcat0/logs/*
rm -fr /data/tomcats/tomcat0/shared/*.jar
mv delonix-web/target/delonix-web-1.0.0-SNAPSHOT/WEB-INF/lib/delonix*.jar /data/tomcats/tomcat0/shared/
rm -fr /data/tomcats/tomcat0/webapps/delonix*
mv delonix-web/target/delonix-web-1.0.0-SNAPSHOT.war /data/tomcats/tomcat0/webapps/delonix.war

service tomcat0 start